package com.capinfo.utils;


import com.capinfo.App;

/**
 * @author: sunbenjin
 * @date: 2020/3/5
 * 预审流程枚举类
 **/

public enum ApprovalFlowEnum {
    CLYSZ(0,"clysz","材料预审中"),
    FHCXTBCL(1,"fhcxtbcl","返回重新填报材料"),
    YSWC(2,"yswc","预审完成"),
    QXYS(3,"qxys","取消预审"),
    NON(-1,"non","non");
    private Integer status;
    private String key;
    private String name;
    private ApprovalFlowEnum(Integer status,String key,String name){
        this.status = status;
        this.key = key;
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public static ApprovalFlowEnum getNowNodeStatus(String name){
        for(ApprovalFlowEnum afe : ApprovalFlowEnum.values()){
            if(afe.name.equals(name)){
                return afe;
            }
        }
        return NON;
    }
    public static ApprovalFlowEnum getNowNodeKey(String name){
        for(ApprovalFlowEnum afe : ApprovalFlowEnum.values()){
            if(afe.name.equals(name)){
                return afe;
            }
        }
        return NON;
    }
    public static ApprovalFlowEnum getNowNodeName(String name){
        for(ApprovalFlowEnum afe : ApprovalFlowEnum.values()){
            if(afe.name.equals(name)){
                return afe;
            }
        }
        return NON;
    }
    public static ApprovalFlowEnum getNowName(String name){
        for(ApprovalFlowEnum afe : ApprovalFlowEnum.values()){
            if(afe.key.equals(name)||afe.status.equals(name)){
                return afe;
            }
        }
        return NON;
    }
}
